<%@ page import="java.util.List" %>
<%@ page import="DroidEye.JavaBean.ProjectBean" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="DroidEye.DAO.TeacherDAO" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<jsp:include page="RightSideBackGroundSetter.jsp"/>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    String teacherID = (String) session.getAttribute("ThisTeacherID");
%>

<% List<ProjectBean> projectBeanList;
    projectBeanList = TeacherDAO.getTeacherDAOInstance().searchProjectGroupbyTeacher(teacherID);
    String teacherName = TeacherDAO.getTeacherDAOInstance().queryTeacherAccount(teacherID).getTeacherName();
%>
    <center class="font25 bold pad10">欢迎<%=teacherID%>号教师！</center>
    <%--<a href="LogoutTest.jsp">退出登录</a>--%>
<%--<a href="TeacherChangePassword.jsp">修改密码</a><br>--%>
<center>
    <div>
        <%
            if (projectBeanList.isEmpty()) {
                out.print("您暂未创建项目，请先");
        %>

        <a href="TeacherPasswordCheck.jsp?URL=TeacherAddProjectTest.jsp">添加项目</a>
    </div>
    <%
    } else {
    %>
    <div  class="font18 bold">
        <%=teacherName%>老师，您创建的项目如下:<br>
    </div>
    <div class="pad10">
        <table id="tab2" class="tablelist wid70-persent">
            <tr>
                <th align="center" valign="middle">项目号</th>
                <th align="center" valign="middle">项目名</th>
            </tr>
            <tr></tr>
            <h2>
                    <%
            for (ProjectBean project : projectBeanList) {

        %>
                <tr>
                    <td align="center" valign="middle">
                        <a href="TeacherPasswordCheck.jsp?&URL=TeacherQueryProject.jsp&Parame=<%=project.getProjectID()%>">
                            <%=project.getProjectID()%>
                        </a></td>
                    <td align="center" valign="middle"><%=project.getProjectName() + ""%>
                    </td>
                </tr>

                    <%
            }


        %>
        </table>
    </div>
    <%--<h1>点此继续--%>
    <%--<a href="TeacherPasswordCheck.jsp?URL=TeacherAddProjectTest.jsp">添加项目</a>--%>
    <%--</h1>--%>
    <br><br><br>
    (点击项目号可查看选择该项目的学生)
    <%
        }
    %>

    </h2>
</center>
</body>
</html>
